//
// Created by 123 on 2025/1/3.
//
#include "iostream"
using namespace std;

class AbstractDrinking{
public:
    //烧水
    virtual void boil() = 0;
    //冲泡
    virtual void brew() = 0;
    //导入杯中
    virtual void pourInCup() = 0;
    //加入辅料
    virtual void putSomeThing() = 0;
    //规定流程
    void makeDrink(){
        boil();
        brew();
        pourInCup();
        putSomeThing();
    }
};

//制作咖啡
class Coffee : public AbstractDrinking{
public:
    virtual void boil(){
        cout << "boiling coffee" << endl;
    }
    virtual void brew(){
        cout << "brewing coffee" << endl;
    }
    virtual void pourInCup(){
        cout << "pourIncuping coffee" << endl;
    }
    virtual void putSomeThing(){
        cout << "putSomeing coffee" << endl;
    }
};
//制作茶水
class Tea : public AbstractDrinking{
public:
    virtual void boil(){
        cout << "boiling...tea" << endl;
    }
    virtual void brew(){
        cout << "brewing...tea" << endl;
    }
    virtual void pourInCup(){
        cout << "pourIncuping...tea" << endl;
    }
    virtual void putSomeThing(){
        cout << "putSomeing...tea" << endl;
    }
};

//void DoWork(AbstractDrinking& drinking){
//    drinking.makeDrink();
//    delete &drinking;
//}
void DoWork(AbstractDrinking* drinking){
    drinking->makeDrink();
    delete drinking;
}

int main090(){
    Tea tea;
//    DoWork(tea);
    DoWork(new Tea);
    Coffee* co = new Coffee;
    DoWork(co);

    return 0;
}